-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: Rotate Catalyst Servers to Retry #127
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM to me so far, it is nice to have the retry mechanism at queue level almost ready, we can see if this rotation of Catalyst fixes the edge cases we are having, otherwise we can go further and finish implementing the retry at queue level or the DLQ as we discussed.
Great work, thanks!
: contentClient | ||
|
||
return retry(() => contentClientToUse.fetchEntityById(entityId), retries, waitTime) | ||
function getContentClientOrDefault(contentServerUrl?: string): ContentClient { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This use case will be very common, we can live with it for now but I think the best thing to do on these cases is to expose a function in catalyst-client
's contentClient
and lambdaClient
like:
function setCatalyst(url: string): void
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@@ -43,10 +41,10 @@ export async function createEventParser({ | |||
} | |||
|
|||
async function parseCatalystEvent(event: any): Promise<CatalystDeploymentEvent | undefined> { | |||
const contentUrl = event.contentServerUrls ? event.contentServerUrls[0] : loadBalancer | |||
const { contentServerUrls } = event |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will this be always populated? maybe we can have a fallback just in case
const results = await Promise.all(asyncResults) | ||
|
||
const badgesToGrant = results.filter(({ ok, result }) => ok && !!result).map(({ result }) => result) | ||
const handlersToRetry = results.filter(({ ok }) => !ok) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would keep it for now but add an underscore so we by-pass the lint warning
const handlersToRetry = results.filter(({ ok }) => !ok) | |
const _handlersToRetry = results.filter(({ ok }) => !ok) |
processor/src/types.ts
Outdated
@@ -127,6 +127,12 @@ export class ParsingEventError extends Error { | |||
} | |||
} | |||
|
|||
export type EventHandlerResponse = { | |||
ok: boolean | |||
result?: any |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is the ObserverResponse, right? I'd name like that and may can we join result and error? so result can be either a correct answer (Badge I think) or a Error type
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
WDYT about naming it EventProcessingResult
? I think this name better reflects the overall outcome of processing an event and aligns more closely with its intended function.
What benefits would we gain by combining both the result and the error? I prefer to keep them separated.
No description provided.